tools/ocaml/xenstored: Fix quota bypass on domain shutdown
authorEdwin Török <edvin.torok@citrix.com>
Wed, 12 Oct 2022 18:13:06 +0000 (19:13 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 1 Nov 2022 13:05:44 +0000 (13:05 +0000)
commitdb471408edd46af403b8bd44d180a928ad7fbb80
treecb3bf8b7aef27bd06ce84a4a7ef74cbd273923ff
parentd084d2c6dff7044956ebdf83a259ad6081a1d921
tools/ocaml/xenstored: Fix quota bypass on domain shutdown

XSA-322 fixed a domid reuse vulnerability by assigning Dom0 as the owner of
any nodes left after a domain is shutdown (e.g. outside its /local/domain/N
tree).

However Dom0 has no quota on purpose, so this opened up another potential
attack vector. Avoid it by deleting these nodes instead of assigning them to
Dom0.

This is part of XSA-419 / CVE-2022-42323.

Fixes: c46eff921209 ("tools/ocaml/xenstored: clean up permissions for dead domains")
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
tools/ocaml/xenstored/perms.ml
tools/ocaml/xenstored/store.ml